<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    function conversion(n){
        console.log(Object.prototype.toString.call(n) );
        if(Object.prototype.toString.call(n) == "[object String]"){
            var aa = []
            aa.push(n.split(''))
            console.log(aa);
        }
        if(Object.prototype.toString.call(n) == "[object Number]"){
            var aa = n.toFixed(2)+""
            console.log(aa);
        }
        if(Object.prototype.toString.call(n) == "[object Array]"){
          var aa  = {0: n[0],1:n[1],2:n[2]}
          console.log(aa);
        }
        if(Object.prototype.toString.call(n) == "[object Object]"){
          var aa = [["name,1"],["log,2"]]
          console.log(aa);
        }
        if(Object.prototype.toString.call(n) == "[object Undefined]"){
             alert("请传入参数")
        }
    }
    // conversion("123")
    // conversion(123.33333)
    // conversion(["1","2","3"])
    conversion({name:1,log:2})
    // conversion()
</script>